let utils = require('../../utils/util')

Page({
  data: {
    currentTab: 0,
    items: [{
        "iconPath": "/pages/images/home.png",
        "selectedIconPath": "/pages/images/home_select.png",
        "text": "首页"
      },
      {
        "iconPath": "/pages/images/tel.png",
        "selectedIconPath": "/pages/images/tel_select.png",
        "text": "通讯录"
      },
      {
        "iconPath": "/pages/images/mine.png",
        "selectedIconPath": "/pages/images/mine_select.png",
        "text": "我的"
      }
    ]
  },
  swichNav: function(e) {
    let that = this;
    console.log(this.data.currentTab)
    if (this.data.currentTab === e.target.dataset.current) {
      return false;
    } else {
      that.setData({
        currentTab: e.target.dataset.current
      })
    }
  },
  onLoad: function(option) {
    this.setData({
      currentTab: option.currentTab
    })

    
  },

  /**
   * 生命周期函数--监听页面显示
   */
  onShow: function() {
  },

  /**
   * 页面相关事件处理函数--监听用户下拉动作
   */
  onPullDownRefresh: function() {
    let home_stop = this.selectComponent('#home_stop')
    home_stop.stop();
  },
})